home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ Jul 89 / W0108-TPopup.SetCurrentIt-Jul89 < prev    next >
Encoding:
Text File  |  1989-08-22  |  1.2 KB  |  39 lines  |  [TEXT/GEOL]

  1. Item    4764306                         22-July-89        14:23
  2.  
  3. From:   D2215                           Dac SW, Wilma Blair, PRT
  4.  
  5. To:     MACAPP.TECH$                    MACAPP Tech
  6.  
  7. cc:     MACAPP.TEST                     MacApp SQA Team
  8.  
  9. Sub:    TPopup.SetCurrentItem fix
  10.  
  11. { this is a revision to my earlier 2.0b9 fix list.  Using this will correct a
  12. problem where a dimmed Popup is un-dimmed, colors are messed up, and the wrong
  13. area of the screen is written to when SetCurrentItem is called from outside
  14. TPopup.}
  15.  
  16. PROCEDURE TPopup.SetCurrentItem(item: INTEGER; redraw: BOOLEAN);
  17. VAR
  18.             menuRect:            Rect;
  19. BEGIN
  20.         IF (fMenuHandle <> NIL) & (item <> fCurrentItem) THEN
  21.                 BEGIN
  22.                         IF fCurrentItem <> 0 THEN
  23.                 SetItemMark(fMenuHandle, fCurrentItem, ' ');
  24.                         IF item <> 0 THEN
  25.                 SetItemMark(fMenuHandle, item, CHR(checkMark));
  26.                         fCurrentItem := item;
  27.                 END;
  28.         IF redraw THEN    
  29.                 BEGIN
  30.                         CalcMenuRect (menuRect);
  31.                         InsetRect (menuRect, -1, -1); { otherwise we lose a pixel }
  32.                         InvalidRect (menuRect );             { InvalidRect does focus    }
  33.                 END;
  34. END;
  35.  
  36. Regards, Les Caudle
  37.  
  38.  
  39.